package cn.tedu.blog.server.controller.api;



import cn.tedu.blog.server.pojo.vo.CategoryListVO;
import cn.tedu.blog.server.service.ICategoryService;
import cn.tedu.blog.server.utils.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/category")
@Api(tags = "前台分类查询模块")
public class ApiCategoryController {

    @Autowired
    private ICategoryService categoryService;

    /*前台缓存*/
    @ApiOperation("查询类别")
    @ApiOperationSupport(order = 100)
    @GetMapping("")
    public JsonResult list(){
        log.debug("接收到查询类别的请求");
        List<CategoryListVO> list=categoryService.AllList();
        return JsonResult.ok(list);
    }

}
